﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ventas.Data.Entities;

namespace Ventas.Data.Mappings
{
    public class CategoryMap : EntityTypeConfiguration<Category>
    {
        public CategoryMap()
        {
            //Name of the table
            ToTable("Category");
            //pk
            HasKey(t =>t.Id);
            //Property
            Property(t =>t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(t =>t.Name);
            Property(t =>t.Description);
        }
    }
}
